package strategy;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 支付宝支付策略实现类
 */
@Component("alipayPayment")
public class AlipayPayment implements PaymentStrategy {
    private String accountId;

    public AlipayPayment(@Value("${payment.alipay.account-id:default@example.com}") String accountId) {
        this.accountId = accountId;
    }

    @Override
    public void pay(double amount) {
        System.out.println("使用支付宝支付：¥" + amount);
        System.out.println("支付宝账号：" + accountId);
        System.out.println("支付完成！");
    }
}